/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Jerome Caron |  */
team = new Array(
new Array(
new Array("class1"),
new Array("class2"),
new Array("class3")

),
new Array(
new Array("class4"),
new Array("class5")

),
null,
new Array(
new Array("class6"),
new Array("class7")

)
);
function fillSelectFromArray(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem) {
var i, j;
var prompt;


var tmpList= window.document.forms['mainform'];
if (tmpList.elements['Make'].options[0].selected ==true){  //clear E and F to null BY QU  
  for (var q=tmpList.elements['E'].options.length;q>=0;q--) tmpList.elements['E'].options[q]=null;  
    // Empty the third drop down box of any choices
  for (var q=tmpList.elements['F'].options.length;q>=0;q--) tmpList.elements['F'].options[q] = null;
     
}
// empty existing items
for (i = selectCtrl.options.length; i >= 0; i--) {
selectCtrl.options[i] = null;
}
prompt = (itemArray != null) ? goodPrompt : badPrompt;
if (prompt == null) {
j = 0;
}
else {
selectCtrl.options[0] = new Option(prompt);
j = 1;
}
if (itemArray != null) {
// add new items
for (i = 0; i < itemArray.length; i++) {
selectCtrl.options[j] = new Option(itemArray[i][0]);
if (itemArray[i][1] != null) {
selectCtrl.options[j].value = itemArray[i][1];
}
j++;
}
// select first item (prompt) for sub list
//selectCtrl.options[0].selected = true;
   }
}
